<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>小海智途</title>
    <meta content="width=device-width, initial-scale=1.0" name="viewport">
    <meta content="" name="keywords">
    <meta content="" name="description">

    <!-- Favicon -->
    <link href="img/logo.png" rel="icon">

    <!-- Google Web Fonts -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Heebo:wght@400;500;600;700&display=swap" rel="stylesheet">
    
    <!-- Icon Font Stylesheet -->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.4.1/font/bootstrap-icons.css" rel="stylesheet">

    <!-- Libraries Stylesheet -->
    <link href="lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">
    <link href="lib/tempusdominus/css/tempusdominus-bootstrap-4.min.css" rel="stylesheet" />

    <!-- Customized Bootstrap Stylesheet -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

    <!-- Template Stylesheet -->
    <link href="css/style.css" rel="stylesheet">
    <style>
      html,
      body,
      #container {
        width: 100%;
        height: 100%;
      }
    </style>
  </head>
  <body>
  	<div class="container-fluid position-relative bg-white d-flex p-0">
        <!-- Spinner Start -->
        <div id="spinner" class="show bg-white position-fixed translate-middle w-100 vh-100 top-50 start-50 d-flex align-items-center justify-content-center">
            <div class="spinner-border text-primary" style="width: 3rem; height: 3rem;" role="status">
                <span class="sr-only">Loading...</span>
            </div>
        </div>
        <!-- Spinner End -->
  	
  	<!-- Sidebar Start -->
        <div th:replace="~{common :: #sidebar}"></div>
     <!-- Sidebar End -->
      <!-- Content Start -->
        <div class="content">
            <!-- Navbar Start -->
            <div th:replace="~{common :: #navbar}"></div>
            <!-- Navbar End -->

			<!-- Map End -->
			<div id="container"></div>
			<!-- Map End -->
            


            <!-- Footer Start -->
            <div th:replace="~{common :: #footer}"></div>
            <!-- Footer End -->
        </div>
        <!-- Content End -->
     
    	<!-- Back to Top -->
        <a href="#" class="btn btn-lg btn-primary btn-lg-square back-to-top"><i class="bi bi-arrow-up"></i></a>
    </div>

    <!-- JavaScript Libraries -->
    <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0/dist/js/bootstrap.bundle.min.js"></script>
    <script src="lib/chart/chart.min.js"></script>
    <script src="lib/easing/easing.min.js"></script>
    <script src="lib/waypoints/waypoints.min.js"></script>
    <script src="lib/owlcarousel/owl.carousel.min.js"></script>
    <script src="lib/tempusdominus/js/moment.min.js"></script>
    <script src="lib/tempusdominus/js/moment-timezone.min.js"></script>
    <script src="lib/tempusdominus/js/tempusdominus-bootstrap-4.min.js"></script>

    <!-- Template Javascript -->
    <script src="js/main.js"></script>
  </body>
</html>



<script type="text/javascript">
  window._AMapSecurityConfig = {
    securityJsCode: "db12ca9a2c46a35ea76b279a1948e7b1",
  };
</script>
<script src="https://webapi.amap.com/loader.js"></script>
<script type="text/javascript">
var arr = new Array();//经纬度坐标数组
  AMapLoader.load({
    key: "8e91d38f528dddb1863594bf39843cae", //申请好的Web端开发者 Key，调用 load 时必填
    version: "2.0", //指定要加载的 JS API 的版本，缺省时默认为 1.4.15
    plugins: ["AMap.ToolBar", "AMap.Scale","AMap.DragRoute"]
  })
    .then((AMap) => {
      const map = new AMap.Map("container");
      
      arr.push(new AMap.LngLat("110.339","20.0401")); //初始的导航起点
      arr.push(new AMap.LngLat("110.474","19.8741")); //初始的导航途经点
      arr.push(new AMap.LngLat("110.354","20.0135")); //初始的导航途经点
      arr.push(new AMap.LngLat("110.344","20.0344")); //初始的导航终点
      var dragRoute = new AMap.DragRoute(map, arr, AMap.DrivingPolicy.LEAST_FEE);
      dragRoute.search(); //查询导航路径并开启拖拽导航
    })
    .catch((e) => {
      console.error(e); //加载错误提示
    });
  window.console.log(arr[0]);
</script>